package com.gitee.wsl.security.hash.bcrypt

import kotlin.test.Test

//
//class BCryptHighCostTest {
//    private val password: CharArray = "1234567890abcdefABCDEF_.,".toCharArray()
//
//    @Rule
//    var timeout: Timeout = object : Timeout(MIN_TIMEOUT) {
//        fun apply(base: Statement?, description: Description?): Statement? {
//            return object : FailOnTimeout(base, MIN_TIMEOUT) {
//                @Override
//                @Throws(Throwable::class)
//                fun evaluate() {
//                    try {
//                        super.evaluate()
//                        throw TimeoutException()
//                    } catch (e: Exception) {
//                    }
//                }
//            }
//        }
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWithMaxCostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(31, password)
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWith30CostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(30, password)
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWith29CostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(29, password)
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWith28CostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(28, password)
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWith27CostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(27, password)
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWith26CostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(26, password)
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWith25CostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(25, password)
//    }
//
//    @Test(expected = TestTimedOutException::class)
//    fun testHashWith24CostFactorAndTimeout() {
//        BCrypt.withDefaults().hash(24, password)
//    }
//
//    companion object {
//        private const val MIN_TIMEOUT = 100
//    }
//}
